import request from '@/utils/request'

export function getList(query) {
  return request({
    url: '/menu/list',
    method: 'get',
    params: query
  })
}
export function getMenuTreeList(query) {
  return request({
    url: '/menu/menu-tree-list',
    method: 'get',
    query
  })
}

export function getInfo(id) {
  return request({
    url: '/menu/info',
    method: 'get',
    params: { id }
  })
}

export function createMenu(data) {
  return request({
    url: '/menu/add',
    method: 'post',
    data
  })
}
export function updateMenu(data) {
  return request({
    url: '/menu/save',
    method: 'post',
    data
  })
}

export function delMenu(id) {
  return request({
    url: '/menu/del',
    method: 'delete',
    params: { id }
  })
}
